//
//  SharListController.m
//  NormalFramework
//
//  Created by beisheng03 on 2018/3/13.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "SharListController.h"
#import "SharListTableCell.h"
#import "SharDetailController.h"
@interface SharListController ()
/** <#note#> */
@property (nonatomic, strong) NSArray *urls;
@end

@implementation SharListController

- (NSArray *)urls{
    
    if (!_urls) {
        _urls = @[@"http://e.hiphotos.baidu.com/zhidao/wh=450,600/sign=b88df6bb9cdda144da5c64b68787fc94/7af40ad162d9f2d3e3767647a2ec8a136327cc37.jpg",
                  @"http://e.hiphotos.baidu.com/zhidao/wh=450,600/sign=b88df6bb9cdda144da5c64b68787fc94/7af40ad162d9f2d3e3767647a2ec8a136327cc37.jpg",
                  @"http://e.hiphotos.baidu.com/zhidao/wh=450,600/sign=b88df6bb9cdda144da5c64b68787fc94/7af40ad162d9f2d3e3767647a2ec8a136327cc37.jpg"];
    }
    
    
    
    return _urls;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"晒单分享";
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SharListTableCell class]) bundle:nil] forCellReuseIdentifier:[SharListTableCell identifierStr]];
    
    self.tableView.estimatedRowHeight = 300;
    self.tableView.estimatedSectionHeaderHeight = 0;
    self.tableView.estimatedSectionFooterHeight = 0;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.tableFooterView = [[UIView alloc]init];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    SharListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:[SharListTableCell identifierStr]];
    
    cell.URLStrings = self.urls;
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    SharDetailController *detail = [[SharDetailController alloc]init];
    
    [self.navigationController pushViewController:detail animated:YES];
    
}



@end
